﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.Web.Script.Services;
using System.Web.Script.Serialization;
using WebSysCore.JSons;
using WebSysCore;
using WebSysCore.Helpers;

namespace HSchSchedule.AjaxPages
{
    public partial class AjaxProvince : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        [WebMethod]
        public static string GetAllProvinces()
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            List<JProvince> lstJProvince = new List<JProvince>();
            List<Province> lstProvince = DataBase.GetAllProvince();
            foreach (Province p in lstProvince)
            {
                JProvince jp = AssignHelp.ProvinceToJProvince(p);
                lstJProvince.Add(jp);
            }
            return serializer.Serialize(lstJProvince);
        }
    }
}
